package com.zsc.newbuds.entity;

import java.io.Serializable;

/**
 * 用户实体类
 * @author D
 */
public class User implements Serializable {

    private Integer userId;
    /**
     * 真实姓名
     */
    private String realName;
    private String password;
    private String userName;
    private String phone;
    /**
     * 头像地址
     */
    private String avatar;
    /**
     * 用户积分
     */
    private int integral;
    private String address;
    /**
     * 志愿者id
     */
    private Integer volunteer;

    /**
     * 二维码
     */
    private String qrCode;


    public User() {
    }

    public User(String password, String userName, String phone, int integral) {
        this.password = password;
        this.userName = userName;
        this.phone = phone;
        this.integral = integral;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }


    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getIntegral() {
        return integral;
    }

    public void setIntegral(int integral) {
        this.integral = integral;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Integer getVolunteer() {
        return volunteer;
    }

    public void setVolunteer(Integer volunteer) {
        this.volunteer = volunteer;
    }

    public String getQrCode() {
        return qrCode;
    }

    public void setQrCode(String qrCode) {
        this.qrCode = qrCode;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", realName='" + realName + '\'' +
                ", password='" + password + '\'' +
                ", userName='" + userName + '\'' +
                ", phone='" + phone + '\'' +
                ", avatar='" + avatar + '\'' +
                ", integral=" + integral +
                ", address='" + address + '\'' +
                ", volunteer=" + volunteer +
                ", qrCode='" + qrCode + '\'' +
                '}';
    }

    /**
     * 转部分属性为json
     * @return
     */
    public String toJson(){
        return "{"+
                "\"userId\":"+userId+
                ",\"realName\":"+"\""+realName+"\""+
                ",\"phone\":"+phone+
                ",\"address\":"+"\""+address+"\""+
                "}";
    }
}
